<?php
namespace PsiFramework\Classes\Util\Database\Query;

import("Classes.Util.Database.SqlQuery");
import("Classes.Util.Database.Query.SqlIndex");
import("Classes.Util.Database.Query.SqlPrimaryKey");
import("Classes.Util.Database.Query.SqlForeignKey");
import("Classes.Util.Database.Query.SqlUniqueKey");

use \PsiFramework\Classes\Util\Database\SqlQuery;
use \PsiFramework\Classes\Util\Database\Query\SqlTable;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The SqlCreateTableQuery class allows to represent a sql create view query
 *
 * @package Util.Database
 */
class SqlCreateViewQuery extends SqlQuery
{

    protected /*SqlQuery*/ $_selectQuery ;

    /**
     * SqlCreateViewQuery constructor
     *
     * @param $table            the view
     * @param $selectQuery        the select query to create the view
     */
    public function __construct(
        SqlTable $table=null,
        SqlQuery $selectQuery=null
    )
    {
        parent::__construct(self::$createView, $table);
        $this->_selectQuery = $selectQuery ;
    }

    public function getSelectQuery()
    {
        return $this->_selectQuery ;
    }

    public function setSelectQuery(SqlQuery $selectQuery)
    {
        $this->_selectQuery = $selectQuery ;
    }
}

